import axios from "../axios";
const method = {
  //下拉框展示父项目信息
  showParentInfo: async function() {
    return await axios({
      method: "get",
      url: "/parentProj/select"
    });
  },
  //根据父项目id查询下拉框信息
  showChildInfo: async function(param) {
    return await axios({
      method: "get",
      url: "/subProj/select?id=" + param
    });
  },
  //新增疫情播报信息
  addInfo: async function(param) {
    return await axios({
      method: "post",
      url: "/epidemicInfo/add",
      data: param,
      header: {
        "Content-Type": "application/json"
      }
    });
  },
  //根据id删除疫情信息
  delInfo: async function(param) {
    return await axios({
      method: "post",
      url: "/epidemicInfo/delete/" + param
    });
  },
  //修改疫情信息
  updateInfo: async function(param) {
    return await axios({
      method: "post",
      url: "/epidemicInfo/update",
      data: param,
      header: {
        "Content-Type": "application/json"
      }
    });
  },
  //根据id查询疫情信息
  queryInfoById: async function(param) {
    return await axios({
      method: "get",
      url: "/epidemicInfo/list/" + param
    });
  },
  //分页查询所有疫情信息
  queryAllInfo: async function(param) {
    return await axios({
      method: "get",
      url: "/epidemicInfo/listAll",
      params: param
    });
  }
};
const addInfo = method.addInfo;
const delInfo = method.delInfo;
const queryAllInfo = method.queryAllInfo;
const showParentInfo = method.showParentInfo;
const showChildInfo = method.showChildInfo;
const queryInfoById = method.queryInfoById;
const updateInfo = method.updateInfo;
export {
  addInfo,
  queryAllInfo,
  showParentInfo,
  delInfo,
  showChildInfo,
  queryInfoById,
  updateInfo
};
